<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>企业员工管理-部门列表</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
  <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
  <link rel="stylesheet" href="static/css/font.css">
  <link rel="stylesheet" href="static/css/xadmin.css">
  <script type="text/javascript" src="static/js/jquery-3.3.1.js"></script>
  <script type="text/javascript" src="static/lib/layui/layui.js"></script>
  <script type="text/javascript" src="static/js/xadmin.js"></script>
  <script type="text/javascript" src="static/js/xadminEmp.js"></script>
</head>

<body class="layui-anim layui-anim-up">

<div class="x-nav">
      <span class="layui-breadcrumb">
        <a >首页</a>
        <a >工作业绩考核</a>
        <a>
          <cite>科室列表</cite></a>
      </span>
  <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" href="javascript:location.replace(location.href);" title="刷新">
    <i class="layui-icon" style="line-height:30px">ဂ</i></a>
</div>
<div class="x-body" id="container">
  <div style="text-align: center">
    <table class="layui-table" lay-data="{height: 'full-160', cellMinWidth:80, url:'empDepartment/findSelective.do', page:true, id:'idTest'}" lay-filter="demo">
      <thead>
      <tr>
      	<th lay-data="{field:'dName', templet: '<span>{{d.department.dName}}</span>',minWidth:110,align: 'center'}">被评科室</th>
        <!--
		<th lay-data="{field:'gLtargetrmk', templet: '<span>{{d.generality.gLtargetrmk}}</span>',minWidth:50,align: 'center'}">评价大类</th>
		<th lay-data="{field:'gTargetname', templet: '<span>{{d.generality.gTargetname}}</span>',minWidth:110,align: 'center'}">评价指标</th>
		-->
        <th lay-data="{fixed: 'right', width:100, align:'center', toolbar: '#barDemo'}"></th>
      </tr>
      </thead>
    </table>
  </div>

</div>
<script type="text/html" id="barDemo">
  <a class="layui-btn layui-btn-xs" lay-event="edit">评价</a>
</script>
<script>
    layui.use('table', function(){
        // layui.use(['form', 'table','layedit', 'laydate'], function(){
        var table = layui.table;

        //监听工具条
        table.on('tool(demo)', function(obj){
            var data = obj.data;

            //console.log("被评科室初始数据=" + JSON.stringify(data));
            //console.log("该科室被评价指标=" + JSON.stringify(data.quantitative.gTargetid));

            if(obj.event === 'detail'){
                layer.msg('ID：'+ data.id + ' 的查看操作');
            }if(obj.event === 'edit'){
                //layer.alert('编辑行：<br>'+ JSON.stringify(data));
                xx_admin_show('部门个性化指标测评',
                		'toPage.do?url=employee/employeeDepInfo.html?dId='+data.department.dId
                		+'&gTargetid='+data.quantitative.qTargetid+'&eAccount='+data.employee.eAccount
  						, 1300,600);
            }
        });

        var $ = layui.$, active = {
            reload: function(){
                var searchName = $('#search-name').val();
                table.reload('idTest', {
                    page: {
                        curr: 1 //重新从第 1 页开始
                    }
                    ,where: {
                        name: searchName
                    }
                });
            }
        };

        $('.demoTable .layui-btn').on('click', function(){
            var type = $(this).data('type');
            active[type] ? active[type].call(this) : '';
        });
    });

</script>
</body>
</html>
